package com.xueyi.tesla.entity.dto;

import com.xueyi.core.base.annotation.Add;
import com.xueyi.core.base.annotation.Update;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author: hxs
 * @createDate: 2022/11/9 10:25
 * @description: 新增 or 修改角色参数
 */
@Data
public class AddOrUpdateRoleDto {

    /**
     * 角色id
     */
    @NotNull(message = "参数异常", groups = {Update.class})
    private Integer id;


    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空", groups = {Add.class, Update.class})
    @Length(min = 1, max = 50, message = "角色名称长度最大为50")
    private String roleName;
}
